<?php
/*
 * Created on 2013-5-25
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 * 
 * @package liaodou
 * @author leimengcheng<leimengcheng@iicall.com>
 * @date 2013-05-25
 */

class Reguser_model extends CI_Model{
	
	/**
	 * var $db_alimobile
	 */
	public $db_alimobile = null;
	
	/**
	 * to operate table
	 */
	public static $TABLE = 'tbl_RegUser';
	
	/**
	 * constructor
	 */
	public function __construct()
	{
		parent::__construct();
		$this->db_alimobile = $this->load->database('alimobile',true);
	}
	
	/**
	 * 根据用户的用户名获得用户UserID
	 * 
	 * @param string $username
	 */
	public function getUserIdByUsername($username)
	{
		$sql = sprintf("SELECT `RU_UserID` as `UserID` FROM `%s` WHERE `RU_RegName` = '%s'",self::$TABLE,$username);
		$query = $this->db_alimobile->query($sql);
		return $query->row_array();
	}
	
}
?>
